<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
  
  <head>
    <title>订单详情</title>
    <jsp:include page="header.jsp"></jsp:include>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
      <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
      <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  <style>
  	.my-pic {
  		display: block;
  		width: 300px;
  	}
  	.my-pic img{
  		display: block;
  		width: 100%;
  	}
  	.my-span {
  		display: block;
  		margin-top: 10px;
  	}
  </style>
  <body>
    <div class="x-body">
        <form class="layui-form" id="myForm" action="/admin/stateChange" method="post">
          <div class="layui-form-item">
              <label for="username" class="layui-form-label">
                  	订单编号:
              </label>
              <div class="layui-input-inline">
                  <input type="text" class="layui-input" value="${order.id}" readonly="readonly">
              </div>
          </div>
          <div class="layui-form-item">
              <label for="username" class="layui-form-label">
                  	商品名称:
              </label>
              <div class="layui-input-inline">
                 <input type="text" class="layui-input" value="${order.goodsName}" readonly="readonly">
              </div>
          </div>
          <div class="layui-form-item">
              <label for="phone" class="layui-form-label">
                  	药品图片:
              </label>
              <div class="layui-input-inline">
                  <span class="my-pic"><img src="${order.goodsPic}" /></span>
              </div>
          </div>
          <div class="layui-form-item">
              <label for="username" class="layui-form-label">
                 	处方图片:
              </label>
              <div class="layui-input-inline">
              		<span class="my-pic"><img src="${order.chufangPic}" onclick="x_admin_show('详情','/admin/detail?str=${order.chufangPic}')"/></span>
              </div>
          </div>
          <div class="layui-form-item">
              <label for="username" class="layui-form-label">
                  	商品价格:
              </label>
              <div class="layui-input-inline">
                  <input type="text" class="layui-input" value="${order.orderPrice}" readonly="readonly">
              </div>
          </div>
          <div class="layui-form-item">
              <label for="username" class="layui-form-label">
                	  购买数量:
              </label>
              <div class="layui-input-inline">
                  <input type="text" class="layui-input" value="${order.orderSum}" readonly="readonly">
              </div>
          </div>
          <div class="layui-form-item">
              <label for="username" class="layui-form-label">
                  	总价格:
              </label>
              <div class="layui-input-inline">
                  <input type="text" class="layui-input" value="${order.orderTotal}" readonly="readonly">
              </div>
          </div>
          <div class="layui-form-item">
              <label for="username" class="layui-form-label">
                  	微信昵称:
              </label>
              <div class="layui-input-inline">
              		<input type="text" class="layui-input" value="${order.weName}" readonly="readonly"> 
              </div>
          </div>
          <div class="layui-form-item">
              <label for="username" class="layui-form-label">
                  	医生姓名:
              </label>
              <div class="layui-input-inline">
              		<input type="text" class="layui-input" value="${order.doctorName}" readonly="readonly"> 
              </div>
          </div>
          <div class="layui-form-item">
              <label for="username" class="layui-form-label">
                  	订单状态:
              </label>
              <div class="layui-input-inline">
              		<span class="my-span">
              			<c:choose>  
						  			<c:when test="${order.orderState==1}"> 
						  				未支付  
						  			</c:when> 
						  			<c:when test="${order.orderState==2}"> 
						  				未审核
						  			</c:when>
						  			<c:when test="${order.orderState==3}"> 
						  				已审核  
						  			</c:when>
						  			<c:when test="${order.orderState==4}">
						  				未发货   
						  			</c:when>
									<c:when test="${order.orderState==5}"> 
						  				已发货 
						  			</c:when>
						  			<c:when test="${order.orderState==6}"> 
						  				已完成
						  			</c:when>
						  			<c:when test="${order.orderState==7}"> 
						  				已退货
						  			</c:when>
						  <c:otherwise> 
						  	订单出问题  
						  </c:otherwise> 
						
						</c:choose>
              		</span>
              </div>
          </div>
          <c:choose>
          <c:when test="${!empty order.orderYuliu}">
           <div class="layui-form-item">
              <label for="username" class="layui-form-label">
                  	药店名称:
              </label>
              <div class="layui-input-inline">
              		<input type="text" class="layui-input" value="${order.houseName}" readonly="readonly"> 
              </div>
          </div>
          <div class="layui-form-item">
              <label for="username" class="layui-form-label">
                  	药店地址:
              </label>
              <div class="layui-input-inline">
              		<input type="text" class="layui-input" value="${order.houseAddress}" readonly="readonly"> 
              </div>
          </div>
          </c:when>
         <c:otherwise>
          <div class="layui-form-item">
              <label for="username" class="layui-form-label">
                  	收货人:
              </label>
              <div class="layui-input-inline">
              		<input type="text" class="layui-input" value="${order.receiptName}" readonly="readonly"> 
              </div>
          </div>
          <div class="layui-form-item">
              <label for="username" class="layui-form-label">
                  	联系电话:
              </label>
              <div class="layui-input-inline">
              		<input type="text" class="layui-input" value="${order.telephone}" readonly="readonly"> 
              </div>
          </div>
          <div class="layui-form-item">
              <label for="username" class="layui-form-label">
                  	配送地址:
              </label>
              <div class="layui-input-inline">
              		<input type="text" class="layui-input" value="${order.addressDetail}" readonly="readonly"> 
              </div>
          </div>
          </c:otherwise>
          </c:choose>
          <div class="layui-form-item">
              <label for="username" class="layui-form-label">
                  <span class="x-red">*</span>不通过原因
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="orderPrepare" name="orderPrepare" required="" lay-verify="required"
                  autocomplete="off" class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label for="username" class="layui-form-label">
                  <span class="x-red">*</span>审核结果
              </label>
              <div class="layui-input-inline">
                  <select name="orderState">
                    <option value="3">审核通过</option>
                    <option value="8">审核不通过</option>
                  </select>
              </div>
          </div>
          <div class="layui-form-item">
              <label for="L_repass" class="layui-form-label">
              	<input type="hidden" name="id" value="${order.id}"> 
              </label>
             <button  class="layui-btn" lay-filter="add" id="my_add">
                  	确定
              </button>
          </div>
      </form>
    </div>
    <script type="text/javascript">
    
    $('#my_add').click(function(){
    	 var form =$('#myForm');
         var index = parent.layer.getFrameIndex(window.name);
         //关闭当前frame
         parent.layer.close(index);
         parent.location.reload();
         form.submit();
    });
    $("#my_pic").click(function(){
    	var ss =$(this).attr("src");
    	var url ="/admin/detail?str="+ss;
    	window.location.href=url;
    	/* var index = layer.open({
    		  type: 2,
    		  content: url,
    		  area: ['320px', '195px'],
    		  maxmin: true
    		}); */
    });
    
	</script>
  </body>
</html>

